<template>
	<view class="withdrawRecord">  
		<view class="withdrawRecordBox me-fx-row-sb-c" v-for="(item, index) in indexDataList">
			<view class="withdrawRecordBoxLeft me-fx-row-start-c">
				<image src="../../static/img/Withdrawal.png" mode="" v-if="item.type == '2'"></image>
				<image src="../../static/img/Recharge.png" mode="" v-else></image>
				<view class="tixianBox">
					<view class="tixianName" v-if="item.type == '1'">
						微信充值
					</view>
					<view class="tixianName" v-else>
						支付宝充值
					</view>
					<view class="tixianTime">
						{{item.created_at}}
					</view>
				</view>
			</view>
			<view class="withdrawRecordBoxRight me-fx-row-start-c">
				<view class="money">
					{{item.money}}￥
				</view>
			</view>
		</view>
	</view>
</template>
	
<script>
	export default {
		data() {
			return {
				page:1,
				indexDataList:[],
				last_page:1,
				zhifubao:true
			}
		},
		created(){
			this.indexData();
		},
		methods: {
			indexData(){
				this.$u.get('/wallet/log/recharge/'+this.page).then(res => {
						if (res) {
							console.log(res,'res')
							this.indexDataList=res.data.list.data
							this.last_page=res.data.list.last_page
						}
					})
					.catch((res) => {
						console.log(res.message)
					})
			},
			onReachBottom(){//uniapp 监听下拉加载生命周期
			if(this.page>=this.last_page){
				uni.showToast({
					title: '没有更多数据了',
					duration: 1000,
					icon: 'none'
				})
				return
			}
			this.page++
			this.IndexData(this.page,this.url)
			},
		}
	}
</script>

<style>
	
	.withdrawRecordBox{
		padding: 0 30rpx;
		height: 172rpx;
		border-bottom: 1rpx solid rgba(245,245,245,1);
		}
		.withdrawRecordBoxLeft image{
			width:90rpx;
			height:90rpx;
			background:rgba(129,129,234,1);
			border-radius:45rpx;
		}
		.tixianBox{
			margin-left: 23rpx;
		}
		.tixianBox .tixianName{
			font-size:32rpx;
			font-weight:bold;
			color:rgba(33,33,33,1);
		}
		.tixianBox .tixianTime{
			font-size:28rpx;
			color:rgba(101,101,101,1);
			margin-top: 20rpx;
		}
		.withdrawRecordBoxRight .money{
			font-size:32rpx;
			color:rgba(33,33,33,1);
		}
</style>
